package cn.tedu.cn;
//测试  多线程售票
//2 需求：设计4个窗口，总计售票100张
public class Test6_Tickets {
    public static void main(String[] args) {
        MyTickets t = new MyTickets();
        t.start();

    }
}
//
class MyTickets  extends  Thread{
    int tickets = 100;
    //准备卖票，把业务放入重写的run()
    @Override
    public void run() {
        while (true){
            if(tickets>0){
                System.out.println(super.getName()+"  "+tickets--);
            }else {
                break;
            }
        }
    }
}
